#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#define maxn 1000000
#define BP_SZ 100
typedef struct{
    char token[120];
    int syn;
}Bingp;

char rwtab[37][20] = {"auto","break","case","char","const","continue","default","do","double","else","enum","extern","float","for","goto","if","inline","int","long","register","restrict","return", "short","signed","sizeof","static","struct","switch","typedef","union","unsigned","void","volatile","while","_Bool","_Complex","_Imaginary"};

int line_num = 0;
char source[maxn];

int pre_process(){
	char pre, now, next;
	int state = 0;
	int ind = 0;
	while(1){
		if(!state){
			now = getchar();
			if(now == EOF) break;
			}else{
			now = next;
			state = 0;
			}
			if(now == '/'){
			next = getchar();
			if(next == '*'){
				while(!(now == '*' && next == '/')){
					now = next;
					next = getchar();
				}
			}
			else if(next == '/'){
				while(!(next == '\n')){
					next = getchar();
				}
			}
			else{
				state = 1;
				source[ind++] = now;
			}
		}
		else if(isspace(now)){
			source[ind++] = ' ';
			line_num++;
			while(1){
				next = getchar();
				if(!isspace(next)) {
					state = 1;
					break;
				}
			}
		}
		else if(now == '\"'){
			source[ind++] = now;
			while(1){
				next = getchar();
				source[ind++] = next;
				if(next == '\\'){
					next = getchar();
					source[ind++] = next;
				}
				else if(next == '\"'){
					break;
				}	
			}
		}
                else if(now == '\\'){
                    source[ind++] = now;
                    next = getchar();
              	    source[ind++] = next;
                }
		else{
			source[ind++] = now;
		}
	}
	return 0;
}

int search(){
    int i = 0, j = 0, k;
    int tag = 0;
    int lens = strlen(source);
    char s[120];
    
    for(i = 0; i < lens; ++i){
        if(isalpha(source[i]) || source[i] == '_'){    
             s[j++] = source[i];      
             i++;
             while(isalnum(source[i]) || source[i] == '_'){
                  s[j++] = source[i];
                  i++;
             }
             s[j] = '\0';
             i--;
             for(k = 0; k < 37; k++){
                 if(!strcmp(s, rwtab[k])) {
                      printf("< %s, %d >\n", s,k+1);
                      tag = 1;
                 }
             }
             if(tag != 1) printf("< %s, id >\n", s);
             j = 0;
             tag = 0;
        }
        else if(isdigit(source[i])){
            s[j++] = source[i];
            i++;
            while(isdigit(source[i]) || source[i] == '.'){
                if(isdigit(source[i])){
                     s[j++] = source[i];
                }
                else if(source[i] == '.' && !tag){
                     if(isdigit(source[i+1])){
                         s[j++] = source[i];
                         tag = 1;
                     }
                     else {
                         s[j++] = source[i];
                         s[j] = '\0';
                         printf(" %s 错误的浮点数输入格式\n", s);
                         return 0;
                     }
                }
                else if(source[i] == '.' && tag == 1){
                     s[j++] = '.';
                     s[j] = '\0';
                     printf(" %s 错误的浮点数输入格式\n", s);
                     return 0;
                }
                i++;
            }          
            s[j++] = '\0';
            i--; 
            if(tag == 1) printf("< %s, float >\n", s);
            else printf("< %s, int >\n", s);
            j = 0;
            tag = 0;
        }
        else if(source[i] == '+'){
            s[j++] = source[i];
            i++;
            if(source[i] == '='){
                s[j++] = '=';
                tag = 1;
            }
            else if(source[i] == '+'){
                s[j++] = '+';
                tag = 2;
            }
            s[j++] = '\0';
            if(tag == 1) printf("< %s, 56 >\n", s);
            else if(tag == 2) printf("< %s, 67>\n", s);
            else printf("< %s, 50 >\n", s);
            j = 0; 
            tag = 0;
        }
        else if(source[i] == '-'){
            s[j++] = source[i];
            i++;
            if(source[i] == '='){
                s[j++] = '=';
                tag = 1;
            }
            else if(source[i] == '-'){
                s[j++] = '-';
                tag = 2;
            }
            s[j++] = '\0';
            if(tag == 1) printf("< %s, 57 >\n", s);
            else if(tag == 2) printf("< %s, 68>\n", s);
            else printf("< %s, 51 >\n", s);
            j = 0; 
            tag = 0;
        }
        else if(source[i] == '*'){
            s[j++] = source[i];
            i++;
            if(source[i] == '='){
                s[j++] = '=';
                tag = 1;
            }
            else if(source[i] == '*'){
                s[j++] = '*';
                tag = 2;
            }
            s[j++] = '\0';
            if(tag == 1) printf("< %s, 54 >\n", s);
            else if(tag == 2) printf("< %s, 69 >\n", s);
            else printf("< %s, 48 >\n", s);
            j = 0; 
            tag = 0;
        }
        else if(source[i] == '/'){
            s[j++] = source[i];
            i++;
            if(source[i] == '='){
                s[j++] = '=';
                tag = 1;
            }
            s[j++] = '\0';
            if(tag == 1) printf("< %s, 55 >\n", s);
            else printf("< %s, 49 >\n", s);
            j = 0; 
            tag = 0;
        }
        else if(source[i] == '|'){
            s[j++] = source[i];
            i++;
            if(source[i] == '='){
                s[j++] = '=';
                tag = 1;
            }
            s[j++] = '\0';
            if(tag == 1) printf("< %s, 59 >\n", s);
            else printf("< %s, 58 >\n", s);
            j = 0; 
            tag = 0;
        }
        else if(source[i] == '&'){
            s[j++] = source[i];
            i++;
            if(source[i] == '='){
                s[j++] = '=';
                tag = 1;
            }
            s[j++] = '\0';
            if(tag == 1) printf("< %s, 53 >\n", s);
            else printf("< %s, 47 >\n", s);
            j = 0; 
            tag = 0;
        }
        else if(source[i] == '!'){
            s[j++] = source[i];
            i++;
            if(source[i] == '='){
                s[j++] = '=';
                tag = 1;
            }
            s[j++] = '\0';
            if(tag == 1) printf("< %s, 52 >\n", s);
            else printf("< %s, 44 >\n", s);
            j = 0; 
            tag = 0;
        }

        else if(source[i] == '^'){
            s[j++] = source[i];
            i++;
            if(source[i] == '='){
                s[j++] = '=';
                tag = 1;
            }
            s[j++] = '\0';
            if(tag == 1) printf("< %s, 600000", s);
            else printf("< %s, 44 >\n", s);
            j = 0; 
            tag = 0;
        }

        else if(source[i] == '('){
            printf("< (, 38 >\n");
        }
        else if(source[i] == ')'){
            printf("< ), 39 >\n");
        }
        else if(source[i] == '['){
            printf("< [, 40 >\n");
        }
        else if(source[i] == ']'){
            printf("< ], 41 >\n");
        }
        else if(source[i] == '{'){
            printf("< {, 42 >\n");
        }
        else if(source[i] == '}'){
            printf("< }, 43 >\n");
        }
        else if(source[i] == '#'){
            printf("< #, 0 >\n");
        }
        else if(source[i] == '<'){
            printf("< <, 65 >\n");
        }
        else if(source[i] == '>'){
            printf("< >, 66 >\n");
        }
        else if(source[i] == ':'){
            printf("< :, 61 >\n");
        }
        else if(source[i] == ';'){
            printf("< ;, 63 >\n");
        }
        else if(source[i] == '?'){
            printf("< ?, 63 >\n");
        }
        else if(source[i] == '%'){
            s[j++] = source[i];
            i++;
            s[j++] = source[i];
            s[j] = '\0';
            printf("< %s, format >\n", s);
            j = 0;
        }

    }
}

int main(){
	int lens, i, j;
	memset(source, 0, sizeof(source));
	pre_process();
	lens = strlen(source);
	for(i = 0; i < lens - 1; ++i){
		putchar(source[i]);
	}
        putchar('\n');
        search();
        
	return 0;
}
